<template>
  <div class="tm-page-view">
    <dv-border-box-6>
      <div class="box">
        <div class="box-echart">
          <i class="el-icon-s-home home" @click="backHome"></i>
          <div class="count-resource">
            <video autoplay loop muted class="video">
              <source
                src="@/assets/large-screen-icon/video/gear-model.webm"
                type="video/webm"
              />
            </video>

            <video autoplay muted class="video">
              <source
                src="@/assets/large-screen-icon/video/tree-model.webm"
                type="video/webm"
              />
            </video>
            <video autoplay muted class="video">
              <source
                src-s="@/assets/largecreen-icon/video/flowLight-model.webm"
                type="video/webm"
              />
            </video>
            <div v-if="oneLevel" class="pop pop1 popcompany"  @click="handelPop('收费')">
              <p>
                收费公司
              </p>
            </div>
            <div v-if="oneLevel" class="pop pop2 popcompany"  @click="handelPop('养护')">
              <p>
                养护公司
              </p>
            </div>
            <div v-if="oneLevel" class="pop pop3 popcompany"  @click="handelPop('高速')">
              <p>
                高速运营
              </p>
            </div>
            <div v-else class="pop popcompany" :class="'pop'+index" v-for="(item, index) in popList" :key="index"  @click="handelPop(item)">
              <p>
                {{item.deptName}}
              </p>
            </div>
          </div>
        </div>
      </div>
    </dv-border-box-6>
  </div>
</template>

<script>
export default {
  name: 'TopMid',
  data () {
    return {
      popList: [],
      oneLevel: true
    }
  },
  mounted () {
    const ele = document.querySelectorAll('.popcompany')
    setTimeout(() => {
      for (let i = 0, len = ele.length; i < len; i++) {
        ele[i].style.display = 'block'
      }
    }, 2000)
  },
  methods: {
    async handelPop (act) {
      this.$emit('handelPop', act)
    },
    backHome () {
      this.oneLevel = true
      this.$emit('handelPop', 'init')
    }
  }
}
</script>

<style lang="scss" scoped>
.tm-page-view {
  padding: 0.25rem;
  height: calc(100% - 0.5rem);
  .box {
    position: relative;
    height: 100%;
    .box-echart {
      width: 90%;
      height: 100%;
      margin: 0 auto;
      .home {
        font-size: .5rem;
        padding-top: .2rem;
        color: beige;
        cursor: pointer;
        z-index: 99999;
        position: absolute;
      }
      .count-resource {
        width: 100%;
        height: 100%;
        .video {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          filter: hue-rotate(202.785deg) saturate(1) brightness(1.7);
        }
      }
    }
  }
  .pop {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    text-align: center;
    line-height: 0.75rem;
    background: url('../../../assets/large-screen-icon/pop.png');
    background-size: 1.5rem 1.5rem;
    position: absolute;
    cursor: pointer;
    p {
      text-align: center;
      white-space: nowrap;
      text-overflow: ellipsis;
      width: 100%;
      overflow: hidden;
      font-family: Microsoft YaHei;
      font-size: 0.25rem;
      color: rgb(255, 191, 62);
      font-weight: bold;
      line-height: 1.125rem;
    }
  }
    .pop0 {
    top: 25%;
    left: 7%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
  .pop1 {
    top: 10%;
    left: 65%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
  .pop2 {
    top: 45%;
    left: 15%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop3 {
    top: 40%;
    left: 75%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop4 {
    top: 65%;
    left: 70%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop5 {
    top: 70%;
    left: 20%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop6 {
    top: 10%;
    left: 30%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop7 {
    top: 60%;
    left: 50%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop8 {
    top: 50%;
    left: 35%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }
    .pop9 {
    top: 30%;
    left: 50%;
    cursor: pointer;
    transition: all 0.6s;
    transform: scale(1.2);
  }

  .pop0:hover,
  .pop1:hover,
  .pop2:hover,
  .pop3:hover,
  .pop4:hover,
  .pop5:hover,
  .pop6:hover,
  .pop7:hover,
  .pop8:hover,
  .pop9:hover {
    transform: scale(1.4);
  }

  #popcompany {
    display: none;
  }
}
</style>
